﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using DBUtility;//Please add references
namespace DAL
{
	/// <summary>
	/// 数据访问类:T_PublicEmployee
	/// </summary>
	public partial class T_PublicEmployee
	{
		public T_PublicEmployee()
		{}
		#region  BasicMethod

		/// <summary>
		/// 增加一条数据
		/// </summary>
		public long Add(Model.T_PublicEmployee model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("insert into T_PublicEmployee(");
			strSql.Append("EmployeeId,LocomotiveNo,EmployeeCardNo,Password,EmployeeName,Sex,Nation,IDnumber,PoliticalStatus,WorkShop,Job,Birthday,TechnicalTitle,CardNumber,EntryTime,PhoneNumber,LicenceDate1,LicenceDate2,Certificate,CertificateType,Education,QQ,DrivingLicenseID,Other,DocumentNo,Remark,Photograph,FingerDescribe,FingerLeft1,FingerLeft2,FingerLeft3,FingerLeft4,FingerLeft5,FingerRight1,FingerRight2,FingerRight3,FingerRight4,FingerRight5,DevSN,DevIME,islogin,ClassGroup,Native,JZ,JB,ZGSJ,RJSJ,GZFL,IsClassLeader,HTGW,SYYZ,RYLY,RYFL,BYSJ,BYXX,XXLB,SXZY,XZHC,YGXS,HTQX,QDSJ,DAGZ,JNGZ,GWGZ,GLGZ,JNJD,DY,GWDX,JNDX,XGW,XGSJ,TXTJ,HZ,FJQK,XSTQ,HKSZD,JTZZ,BZ,SFZH,GZZH,HYDM,SCZ,GZXM,QTGZ,BYSJ1,TBZ,PY,GRJD,LTRQ,GLZD,HTZZ,LWQS,LWZZ,NL,GZSJ,SYQ,JCRQ,JCYY,SHBZ,JJBC,YLBZ,HTBH,ZH,YGFL,HTQ,HTZ,DQ,GWHGZSBH,Image)");
			strSql.Append(" values (");
			strSql.Append("@EmployeeId,@LocomotiveNo,@EmployeeCardNo,@Password,@EmployeeName,@Sex,@Nation,@IDnumber,@PoliticalStatus,@WorkShop,@Job,@Birthday,@TechnicalTitle,@CardNumber,@EntryTime,@PhoneNumber,@LicenceDate1,@LicenceDate2,@Certificate,@CertificateType,@Education,@QQ,@DrivingLicenseID,@Other,@DocumentNo,@Remark,@Photograph,@FingerDescribe,@FingerLeft1,@FingerLeft2,@FingerLeft3,@FingerLeft4,@FingerLeft5,@FingerRight1,@FingerRight2,@FingerRight3,@FingerRight4,@FingerRight5,@DevSN,@DevIME,@islogin,@ClassGroup,@Native,@JZ,@JB,@ZGSJ,@RJSJ,@GZFL,@IsClassLeader,@HTGW,@SYYZ,@RYLY,@RYFL,@BYSJ,@BYXX,@XXLB,@SXZY,@XZHC,@YGXS,@HTQX,@QDSJ,@DAGZ,@JNGZ,@GWGZ,@GLGZ,@JNJD,@DY,@GWDX,@JNDX,@XGW,@XGSJ,@TXTJ,@HZ,@FJQK,@XSTQ,@HKSZD,@JTZZ,@BZ,@SFZH,@GZZH,@HYDM,@SCZ,@GZXM,@QTGZ,@BYSJ1,@TBZ,@PY,@GRJD,@LTRQ,@GLZD,@HTZZ,@LWQS,@LWZZ,@NL,@GZSJ,@SYQ,@JCRQ,@JCYY,@SHBZ,@JJBC,@YLBZ,@HTBH,@ZH,@YGFL,@HTQ,@HTZ,@DQ,@GWHGZSBH,@Image)");
			strSql.Append(";select @@IDENTITY");
			SqlParameter[] parameters = {
					new SqlParameter("@EmployeeId", SqlDbType.NVarChar,20),
					new SqlParameter("@LocomotiveNo", SqlDbType.NVarChar,50),
					new SqlParameter("@EmployeeCardNo", SqlDbType.NVarChar,50),
					new SqlParameter("@Password", SqlDbType.NVarChar,50),
					new SqlParameter("@EmployeeName", SqlDbType.NVarChar,50),
					new SqlParameter("@Sex", SqlDbType.NVarChar,50),
					new SqlParameter("@Nation", SqlDbType.NVarChar,50),
					new SqlParameter("@IDnumber", SqlDbType.NVarChar,50),
					new SqlParameter("@PoliticalStatus", SqlDbType.NVarChar,50),
					new SqlParameter("@WorkShop", SqlDbType.NVarChar,50),
					new SqlParameter("@Job", SqlDbType.NVarChar,50),
					new SqlParameter("@Birthday", SqlDbType.NVarChar,10),
					new SqlParameter("@TechnicalTitle", SqlDbType.NVarChar,50),
					new SqlParameter("@CardNumber", SqlDbType.NVarChar,50),
					new SqlParameter("@EntryTime", SqlDbType.NVarChar,10),
					new SqlParameter("@PhoneNumber", SqlDbType.NVarChar,50),
					new SqlParameter("@LicenceDate1", SqlDbType.NVarChar,20),
					new SqlParameter("@LicenceDate2", SqlDbType.NVarChar,20),
					new SqlParameter("@Certificate", SqlDbType.VarChar,50),
					new SqlParameter("@CertificateType", SqlDbType.VarChar,10),
					new SqlParameter("@Education", SqlDbType.VarChar,10),
					new SqlParameter("@QQ", SqlDbType.VarChar,50),
					new SqlParameter("@DrivingLicenseID", SqlDbType.VarChar,50),
					new SqlParameter("@Other", SqlDbType.VarChar,50),
					new SqlParameter("@DocumentNo", SqlDbType.VarChar,50),
					new SqlParameter("@Remark", SqlDbType.VarChar,500),
					new SqlParameter("@Photograph", SqlDbType.Image),
					new SqlParameter("@FingerDescribe", SqlDbType.NVarChar,50),
					new SqlParameter("@FingerLeft1", SqlDbType.Image),
					new SqlParameter("@FingerLeft2", SqlDbType.Image),
					new SqlParameter("@FingerLeft3", SqlDbType.Image),
					new SqlParameter("@FingerLeft4", SqlDbType.Image),
					new SqlParameter("@FingerLeft5", SqlDbType.Image),
					new SqlParameter("@FingerRight1", SqlDbType.Image),
					new SqlParameter("@FingerRight2", SqlDbType.Image),
					new SqlParameter("@FingerRight3", SqlDbType.Image),
					new SqlParameter("@FingerRight4", SqlDbType.Image),
					new SqlParameter("@FingerRight5", SqlDbType.Image),
					new SqlParameter("@DevSN", SqlDbType.NVarChar,50),
					new SqlParameter("@DevIME", SqlDbType.NVarChar,50),
					new SqlParameter("@islogin", SqlDbType.Bit,1),
					new SqlParameter("@ClassGroup", SqlDbType.NVarChar,30),
					new SqlParameter("@Native", SqlDbType.NVarChar,100),
					new SqlParameter("@JZ", SqlDbType.NVarChar,50),
					new SqlParameter("@JB", SqlDbType.NVarChar,50),
					new SqlParameter("@ZGSJ", SqlDbType.VarChar,20),
					new SqlParameter("@RJSJ", SqlDbType.VarChar,20),
					new SqlParameter("@GZFL", SqlDbType.NVarChar,20),
					new SqlParameter("@IsClassLeader", SqlDbType.NVarChar,5),
					new SqlParameter("@HTGW", SqlDbType.NVarChar,20),
					new SqlParameter("@SYYZ", SqlDbType.NVarChar,20),
					new SqlParameter("@RYLY", SqlDbType.NVarChar,20),
					new SqlParameter("@RYFL", SqlDbType.NVarChar,20),
					new SqlParameter("@BYSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@BYXX", SqlDbType.NVarChar,60),
					new SqlParameter("@XXLB", SqlDbType.NVarChar,20),
					new SqlParameter("@SXZY", SqlDbType.NVarChar,30),
					new SqlParameter("@XZHC", SqlDbType.NVarChar,100),
					new SqlParameter("@YGXS", SqlDbType.NVarChar,20),
					new SqlParameter("@HTQX", SqlDbType.NVarChar,30),
					new SqlParameter("@QDSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@DAGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@JNGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@GWGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@GLGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@JNJD", SqlDbType.NVarChar,30),
					new SqlParameter("@DY", SqlDbType.NVarChar,20),
					new SqlParameter("@GWDX", SqlDbType.NVarChar,10),
					new SqlParameter("@JNDX", SqlDbType.NVarChar,10),
					new SqlParameter("@XGW", SqlDbType.NVarChar,10),
					new SqlParameter("@XGSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@TXTJ", SqlDbType.NVarChar,30),
					new SqlParameter("@HZ", SqlDbType.NVarChar,30),
					new SqlParameter("@FJQK", SqlDbType.NVarChar,50),
					new SqlParameter("@XSTQ", SqlDbType.NVarChar,10),
					new SqlParameter("@HKSZD", SqlDbType.NVarChar,50),
					new SqlParameter("@JTZZ", SqlDbType.NVarChar,100),
					new SqlParameter("@BZ", SqlDbType.NVarChar,200),
					new SqlParameter("@SFZH", SqlDbType.NVarChar,20),
					new SqlParameter("@GZZH", SqlDbType.NVarChar,50),
					new SqlParameter("@HYDM", SqlDbType.NVarChar,20),
					new SqlParameter("@SCZ", SqlDbType.NVarChar,50),
					new SqlParameter("@GZXM", SqlDbType.NVarChar,10),
					new SqlParameter("@QTGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@BYSJ1", SqlDbType.NVarChar,10),
					new SqlParameter("@TBZ", SqlDbType.NVarChar,10),
					new SqlParameter("@PY", SqlDbType.NVarChar,10),
					new SqlParameter("@GRJD", SqlDbType.NVarChar,20),
					new SqlParameter("@LTRQ", SqlDbType.NVarChar,20),
					new SqlParameter("@GLZD", SqlDbType.NVarChar,20),
					new SqlParameter("@HTZZ", SqlDbType.NVarChar,20),
					new SqlParameter("@LWQS", SqlDbType.NVarChar,20),
					new SqlParameter("@LWZZ", SqlDbType.NVarChar,20),
					new SqlParameter("@NL", SqlDbType.NVarChar,20),
					new SqlParameter("@GZSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@SYQ", SqlDbType.NVarChar,20),
					new SqlParameter("@JCRQ", SqlDbType.NVarChar,20),
					new SqlParameter("@JCYY", SqlDbType.NVarChar,50),
					new SqlParameter("@SHBZ", SqlDbType.NVarChar,20),
					new SqlParameter("@JJBC", SqlDbType.NVarChar,20),
					new SqlParameter("@YLBZ", SqlDbType.NVarChar,20),
					new SqlParameter("@HTBH", SqlDbType.NVarChar,20),
					new SqlParameter("@ZH", SqlDbType.NVarChar,20),
					new SqlParameter("@YGFL", SqlDbType.NVarChar,20),
					new SqlParameter("@HTQ", SqlDbType.NVarChar,20),
					new SqlParameter("@HTZ", SqlDbType.NVarChar,20),
					new SqlParameter("@DQ", SqlDbType.NVarChar,20),
					new SqlParameter("@GWHGZSBH", SqlDbType.NVarChar,30),
					new SqlParameter("@Image", SqlDbType.Image)};
			parameters[0].Value = model.EmployeeId;
			parameters[1].Value = model.LocomotiveNo;
			parameters[2].Value = model.EmployeeCardNo;
			parameters[3].Value = model.Password;
			parameters[4].Value = model.EmployeeName;
			parameters[5].Value = model.Sex;
			parameters[6].Value = model.Nation;
			parameters[7].Value = model.IDnumber;
			parameters[8].Value = model.PoliticalStatus;
			parameters[9].Value = model.WorkShop;
			parameters[10].Value = model.Job;
			parameters[11].Value = model.Birthday;
			parameters[12].Value = model.TechnicalTitle;
			parameters[13].Value = model.CardNumber;
			parameters[14].Value = model.EntryTime;
			parameters[15].Value = model.PhoneNumber;
			parameters[16].Value = model.LicenceDate1;
			parameters[17].Value = model.LicenceDate2;
			parameters[18].Value = model.Certificate;
			parameters[19].Value = model.CertificateType;
			parameters[20].Value = model.Education;
			parameters[21].Value = model.QQ;
			parameters[22].Value = model.DrivingLicenseID;
			parameters[23].Value = model.Other;
			parameters[24].Value = model.DocumentNo;
			parameters[25].Value = model.Remark;
			parameters[26].Value = model.Photograph;
			parameters[27].Value = model.FingerDescribe;
			parameters[28].Value = model.FingerLeft1;
			parameters[29].Value = model.FingerLeft2;
			parameters[30].Value = model.FingerLeft3;
			parameters[31].Value = model.FingerLeft4;
			parameters[32].Value = model.FingerLeft5;
			parameters[33].Value = model.FingerRight1;
			parameters[34].Value = model.FingerRight2;
			parameters[35].Value = model.FingerRight3;
			parameters[36].Value = model.FingerRight4;
			parameters[37].Value = model.FingerRight5;
			parameters[38].Value = model.DevSN;
			parameters[39].Value = model.DevIME;
			parameters[40].Value = model.islogin;
			parameters[41].Value = model.ClassGroup;
			parameters[42].Value = model.Native;
			parameters[43].Value = model.JZ;
			parameters[44].Value = model.JB;
			parameters[45].Value = model.ZGSJ;
			parameters[46].Value = model.RJSJ;
			parameters[47].Value = model.GZFL;
			parameters[48].Value = model.IsClassLeader;
			parameters[49].Value = model.HTGW;
			parameters[50].Value = model.SYYZ;
			parameters[51].Value = model.RYLY;
			parameters[52].Value = model.RYFL;
			parameters[53].Value = model.BYSJ;
			parameters[54].Value = model.BYXX;
			parameters[55].Value = model.XXLB;
			parameters[56].Value = model.SXZY;
			parameters[57].Value = model.XZHC;
			parameters[58].Value = model.YGXS;
			parameters[59].Value = model.HTQX;
			parameters[60].Value = model.QDSJ;
			parameters[61].Value = model.DAGZ;
			parameters[62].Value = model.JNGZ;
			parameters[63].Value = model.GWGZ;
			parameters[64].Value = model.GLGZ;
			parameters[65].Value = model.JNJD;
			parameters[66].Value = model.DY;
			parameters[67].Value = model.GWDX;
			parameters[68].Value = model.JNDX;
			parameters[69].Value = model.XGW;
			parameters[70].Value = model.XGSJ;
			parameters[71].Value = model.TXTJ;
			parameters[72].Value = model.HZ;
			parameters[73].Value = model.FJQK;
			parameters[74].Value = model.XSTQ;
			parameters[75].Value = model.HKSZD;
			parameters[76].Value = model.JTZZ;
			parameters[77].Value = model.BZ;
			parameters[78].Value = model.SFZH;
			parameters[79].Value = model.GZZH;
			parameters[80].Value = model.HYDM;
			parameters[81].Value = model.SCZ;
			parameters[82].Value = model.GZXM;
			parameters[83].Value = model.QTGZ;
			parameters[84].Value = model.BYSJ1;
			parameters[85].Value = model.TBZ;
			parameters[86].Value = model.PY;
			parameters[87].Value = model.GRJD;
			parameters[88].Value = model.LTRQ;
			parameters[89].Value = model.GLZD;
			parameters[90].Value = model.HTZZ;
			parameters[91].Value = model.LWQS;
			parameters[92].Value = model.LWZZ;
			parameters[93].Value = model.NL;
			parameters[94].Value = model.GZSJ;
			parameters[95].Value = model.SYQ;
			parameters[96].Value = model.JCRQ;
			parameters[97].Value = model.JCYY;
			parameters[98].Value = model.SHBZ;
			parameters[99].Value = model.JJBC;
			parameters[100].Value = model.YLBZ;
			parameters[101].Value = model.HTBH;
			parameters[102].Value = model.ZH;
			parameters[103].Value = model.YGFL;
			parameters[104].Value = model.HTQ;
			parameters[105].Value = model.HTZ;
			parameters[106].Value = model.DQ;
			parameters[107].Value = model.GWHGZSBH;
			parameters[108].Value = model.Image;

			object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt64(obj);
			}
		}
		/// <summary>
		/// 更新一条数据
		/// </summary>
		public bool Update(Model.T_PublicEmployee model)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("update T_PublicEmployee set ");
			strSql.Append("EmployeeId=@EmployeeId,");
			strSql.Append("LocomotiveNo=@LocomotiveNo,");
			strSql.Append("EmployeeCardNo=@EmployeeCardNo,");
			strSql.Append("Password=@Password,");
			strSql.Append("EmployeeName=@EmployeeName,");
			strSql.Append("Sex=@Sex,");
			strSql.Append("Nation=@Nation,");
			strSql.Append("IDnumber=@IDnumber,");
			strSql.Append("PoliticalStatus=@PoliticalStatus,");
			strSql.Append("WorkShop=@WorkShop,");
			strSql.Append("Job=@Job,");
			strSql.Append("Birthday=@Birthday,");
			strSql.Append("TechnicalTitle=@TechnicalTitle,");
			strSql.Append("CardNumber=@CardNumber,");
			strSql.Append("EntryTime=@EntryTime,");
			strSql.Append("PhoneNumber=@PhoneNumber,");
			strSql.Append("LicenceDate1=@LicenceDate1,");
			strSql.Append("LicenceDate2=@LicenceDate2,");
			strSql.Append("Certificate=@Certificate,");
			strSql.Append("CertificateType=@CertificateType,");
			strSql.Append("Education=@Education,");
			strSql.Append("QQ=@QQ,");
			strSql.Append("DrivingLicenseID=@DrivingLicenseID,");
			strSql.Append("Other=@Other,");
			strSql.Append("DocumentNo=@DocumentNo,");
			strSql.Append("Remark=@Remark,");
			strSql.Append("Photograph=@Photograph,");
			strSql.Append("FingerDescribe=@FingerDescribe,");
			strSql.Append("FingerLeft1=@FingerLeft1,");
			strSql.Append("FingerLeft2=@FingerLeft2,");
			strSql.Append("FingerLeft3=@FingerLeft3,");
			strSql.Append("FingerLeft4=@FingerLeft4,");
			strSql.Append("FingerLeft5=@FingerLeft5,");
			strSql.Append("FingerRight1=@FingerRight1,");
			strSql.Append("FingerRight2=@FingerRight2,");
			strSql.Append("FingerRight3=@FingerRight3,");
			strSql.Append("FingerRight4=@FingerRight4,");
			strSql.Append("FingerRight5=@FingerRight5,");
			strSql.Append("DevSN=@DevSN,");
			strSql.Append("DevIME=@DevIME,");
			strSql.Append("islogin=@islogin,");
			strSql.Append("ClassGroup=@ClassGroup,");
			strSql.Append("Native=@Native,");
			strSql.Append("JZ=@JZ,");
			strSql.Append("JB=@JB,");
			strSql.Append("ZGSJ=@ZGSJ,");
			strSql.Append("RJSJ=@RJSJ,");
			strSql.Append("GZFL=@GZFL,");
			strSql.Append("IsClassLeader=@IsClassLeader,");
			strSql.Append("HTGW=@HTGW,");
			strSql.Append("SYYZ=@SYYZ,");
			strSql.Append("RYLY=@RYLY,");
			strSql.Append("RYFL=@RYFL,");
			strSql.Append("BYSJ=@BYSJ,");
			strSql.Append("BYXX=@BYXX,");
			strSql.Append("XXLB=@XXLB,");
			strSql.Append("SXZY=@SXZY,");
			strSql.Append("XZHC=@XZHC,");
			strSql.Append("YGXS=@YGXS,");
			strSql.Append("HTQX=@HTQX,");
			strSql.Append("QDSJ=@QDSJ,");
			strSql.Append("DAGZ=@DAGZ,");
			strSql.Append("JNGZ=@JNGZ,");
			strSql.Append("GWGZ=@GWGZ,");
			strSql.Append("GLGZ=@GLGZ,");
			strSql.Append("JNJD=@JNJD,");
			strSql.Append("DY=@DY,");
			strSql.Append("GWDX=@GWDX,");
			strSql.Append("JNDX=@JNDX,");
			strSql.Append("XGW=@XGW,");
			strSql.Append("XGSJ=@XGSJ,");
			strSql.Append("TXTJ=@TXTJ,");
			strSql.Append("HZ=@HZ,");
			strSql.Append("FJQK=@FJQK,");
			strSql.Append("XSTQ=@XSTQ,");
			strSql.Append("HKSZD=@HKSZD,");
			strSql.Append("JTZZ=@JTZZ,");
			strSql.Append("BZ=@BZ,");
			strSql.Append("SFZH=@SFZH,");
			strSql.Append("GZZH=@GZZH,");
			strSql.Append("HYDM=@HYDM,");
			strSql.Append("SCZ=@SCZ,");
			strSql.Append("GZXM=@GZXM,");
			strSql.Append("QTGZ=@QTGZ,");
			strSql.Append("BYSJ1=@BYSJ1,");
			strSql.Append("TBZ=@TBZ,");
			strSql.Append("PY=@PY,");
			strSql.Append("GRJD=@GRJD,");
			strSql.Append("LTRQ=@LTRQ,");
			strSql.Append("GLZD=@GLZD,");
			strSql.Append("HTZZ=@HTZZ,");
			strSql.Append("LWQS=@LWQS,");
			strSql.Append("LWZZ=@LWZZ,");
			strSql.Append("NL=@NL,");
			strSql.Append("GZSJ=@GZSJ,");
			strSql.Append("SYQ=@SYQ,");
			strSql.Append("JCRQ=@JCRQ,");
			strSql.Append("JCYY=@JCYY,");
			strSql.Append("SHBZ=@SHBZ,");
			strSql.Append("JJBC=@JJBC,");
			strSql.Append("YLBZ=@YLBZ,");
			strSql.Append("HTBH=@HTBH,");
			strSql.Append("ZH=@ZH,");
			strSql.Append("YGFL=@YGFL,");
			strSql.Append("HTQ=@HTQ,");
			strSql.Append("HTZ=@HTZ,");
			strSql.Append("DQ=@DQ,");
			strSql.Append("GWHGZSBH=@GWHGZSBH,");
			strSql.Append("Image=@Image");
			strSql.Append(" where FID=@FID");
			SqlParameter[] parameters = {
					new SqlParameter("@EmployeeId", SqlDbType.NVarChar,20),
					new SqlParameter("@LocomotiveNo", SqlDbType.NVarChar,50),
					new SqlParameter("@EmployeeCardNo", SqlDbType.NVarChar,50),
					new SqlParameter("@Password", SqlDbType.NVarChar,50),
					new SqlParameter("@EmployeeName", SqlDbType.NVarChar,50),
					new SqlParameter("@Sex", SqlDbType.NVarChar,50),
					new SqlParameter("@Nation", SqlDbType.NVarChar,50),
					new SqlParameter("@IDnumber", SqlDbType.NVarChar,50),
					new SqlParameter("@PoliticalStatus", SqlDbType.NVarChar,50),
					new SqlParameter("@WorkShop", SqlDbType.NVarChar,50),
					new SqlParameter("@Job", SqlDbType.NVarChar,50),
					new SqlParameter("@Birthday", SqlDbType.NVarChar,10),
					new SqlParameter("@TechnicalTitle", SqlDbType.NVarChar,50),
					new SqlParameter("@CardNumber", SqlDbType.NVarChar,50),
					new SqlParameter("@EntryTime", SqlDbType.NVarChar,10),
					new SqlParameter("@PhoneNumber", SqlDbType.NVarChar,50),
					new SqlParameter("@LicenceDate1", SqlDbType.NVarChar,20),
					new SqlParameter("@LicenceDate2", SqlDbType.NVarChar,20),
					new SqlParameter("@Certificate", SqlDbType.VarChar,50),
					new SqlParameter("@CertificateType", SqlDbType.VarChar,10),
					new SqlParameter("@Education", SqlDbType.VarChar,10),
					new SqlParameter("@QQ", SqlDbType.VarChar,50),
					new SqlParameter("@DrivingLicenseID", SqlDbType.VarChar,50),
					new SqlParameter("@Other", SqlDbType.VarChar,50),
					new SqlParameter("@DocumentNo", SqlDbType.VarChar,50),
					new SqlParameter("@Remark", SqlDbType.VarChar,500),
					new SqlParameter("@Photograph", SqlDbType.Image),
					new SqlParameter("@FingerDescribe", SqlDbType.NVarChar,50),
					new SqlParameter("@FingerLeft1", SqlDbType.Image),
					new SqlParameter("@FingerLeft2", SqlDbType.Image),
					new SqlParameter("@FingerLeft3", SqlDbType.Image),
					new SqlParameter("@FingerLeft4", SqlDbType.Image),
					new SqlParameter("@FingerLeft5", SqlDbType.Image),
					new SqlParameter("@FingerRight1", SqlDbType.Image),
					new SqlParameter("@FingerRight2", SqlDbType.Image),
					new SqlParameter("@FingerRight3", SqlDbType.Image),
					new SqlParameter("@FingerRight4", SqlDbType.Image),
					new SqlParameter("@FingerRight5", SqlDbType.Image),
					new SqlParameter("@DevSN", SqlDbType.NVarChar,50),
					new SqlParameter("@DevIME", SqlDbType.NVarChar,50),
					new SqlParameter("@islogin", SqlDbType.Bit,1),
					new SqlParameter("@ClassGroup", SqlDbType.NVarChar,30),
					new SqlParameter("@Native", SqlDbType.NVarChar,100),
					new SqlParameter("@JZ", SqlDbType.NVarChar,50),
					new SqlParameter("@JB", SqlDbType.NVarChar,50),
					new SqlParameter("@ZGSJ", SqlDbType.VarChar,20),
					new SqlParameter("@RJSJ", SqlDbType.VarChar,20),
					new SqlParameter("@GZFL", SqlDbType.NVarChar,20),
					new SqlParameter("@IsClassLeader", SqlDbType.NVarChar,5),
					new SqlParameter("@HTGW", SqlDbType.NVarChar,20),
					new SqlParameter("@SYYZ", SqlDbType.NVarChar,20),
					new SqlParameter("@RYLY", SqlDbType.NVarChar,20),
					new SqlParameter("@RYFL", SqlDbType.NVarChar,20),
					new SqlParameter("@BYSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@BYXX", SqlDbType.NVarChar,60),
					new SqlParameter("@XXLB", SqlDbType.NVarChar,20),
					new SqlParameter("@SXZY", SqlDbType.NVarChar,30),
					new SqlParameter("@XZHC", SqlDbType.NVarChar,100),
					new SqlParameter("@YGXS", SqlDbType.NVarChar,20),
					new SqlParameter("@HTQX", SqlDbType.NVarChar,30),
					new SqlParameter("@QDSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@DAGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@JNGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@GWGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@GLGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@JNJD", SqlDbType.NVarChar,30),
					new SqlParameter("@DY", SqlDbType.NVarChar,20),
					new SqlParameter("@GWDX", SqlDbType.NVarChar,10),
					new SqlParameter("@JNDX", SqlDbType.NVarChar,10),
					new SqlParameter("@XGW", SqlDbType.NVarChar,10),
					new SqlParameter("@XGSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@TXTJ", SqlDbType.NVarChar,30),
					new SqlParameter("@HZ", SqlDbType.NVarChar,30),
					new SqlParameter("@FJQK", SqlDbType.NVarChar,50),
					new SqlParameter("@XSTQ", SqlDbType.NVarChar,10),
					new SqlParameter("@HKSZD", SqlDbType.NVarChar,50),
					new SqlParameter("@JTZZ", SqlDbType.NVarChar,100),
					new SqlParameter("@BZ", SqlDbType.NVarChar,200),
					new SqlParameter("@SFZH", SqlDbType.NVarChar,20),
					new SqlParameter("@GZZH", SqlDbType.NVarChar,50),
					new SqlParameter("@HYDM", SqlDbType.NVarChar,20),
					new SqlParameter("@SCZ", SqlDbType.NVarChar,50),
					new SqlParameter("@GZXM", SqlDbType.NVarChar,10),
					new SqlParameter("@QTGZ", SqlDbType.NVarChar,10),
					new SqlParameter("@BYSJ1", SqlDbType.NVarChar,10),
					new SqlParameter("@TBZ", SqlDbType.NVarChar,10),
					new SqlParameter("@PY", SqlDbType.NVarChar,10),
					new SqlParameter("@GRJD", SqlDbType.NVarChar,20),
					new SqlParameter("@LTRQ", SqlDbType.NVarChar,20),
					new SqlParameter("@GLZD", SqlDbType.NVarChar,20),
					new SqlParameter("@HTZZ", SqlDbType.NVarChar,20),
					new SqlParameter("@LWQS", SqlDbType.NVarChar,20),
					new SqlParameter("@LWZZ", SqlDbType.NVarChar,20),
					new SqlParameter("@NL", SqlDbType.NVarChar,20),
					new SqlParameter("@GZSJ", SqlDbType.NVarChar,20),
					new SqlParameter("@SYQ", SqlDbType.NVarChar,20),
					new SqlParameter("@JCRQ", SqlDbType.NVarChar,20),
					new SqlParameter("@JCYY", SqlDbType.NVarChar,50),
					new SqlParameter("@SHBZ", SqlDbType.NVarChar,20),
					new SqlParameter("@JJBC", SqlDbType.NVarChar,20),
					new SqlParameter("@YLBZ", SqlDbType.NVarChar,20),
					new SqlParameter("@HTBH", SqlDbType.NVarChar,20),
					new SqlParameter("@ZH", SqlDbType.NVarChar,20),
					new SqlParameter("@YGFL", SqlDbType.NVarChar,20),
					new SqlParameter("@HTQ", SqlDbType.NVarChar,20),
					new SqlParameter("@HTZ", SqlDbType.NVarChar,20),
					new SqlParameter("@DQ", SqlDbType.NVarChar,20),
					new SqlParameter("@GWHGZSBH", SqlDbType.NVarChar,30),
					new SqlParameter("@Image", SqlDbType.Image),
					new SqlParameter("@FID", SqlDbType.BigInt,8)};
			parameters[0].Value = model.EmployeeId;
			parameters[1].Value = model.LocomotiveNo;
			parameters[2].Value = model.EmployeeCardNo;
			parameters[3].Value = model.Password;
			parameters[4].Value = model.EmployeeName;
			parameters[5].Value = model.Sex;
			parameters[6].Value = model.Nation;
			parameters[7].Value = model.IDnumber;
			parameters[8].Value = model.PoliticalStatus;
			parameters[9].Value = model.WorkShop;
			parameters[10].Value = model.Job;
			parameters[11].Value = model.Birthday;
			parameters[12].Value = model.TechnicalTitle;
			parameters[13].Value = model.CardNumber;
			parameters[14].Value = model.EntryTime;
			parameters[15].Value = model.PhoneNumber;
			parameters[16].Value = model.LicenceDate1;
			parameters[17].Value = model.LicenceDate2;
			parameters[18].Value = model.Certificate;
			parameters[19].Value = model.CertificateType;
			parameters[20].Value = model.Education;
			parameters[21].Value = model.QQ;
			parameters[22].Value = model.DrivingLicenseID;
			parameters[23].Value = model.Other;
			parameters[24].Value = model.DocumentNo;
			parameters[25].Value = model.Remark;
			parameters[26].Value = model.Photograph;
			parameters[27].Value = model.FingerDescribe;
			parameters[28].Value = model.FingerLeft1;
			parameters[29].Value = model.FingerLeft2;
			parameters[30].Value = model.FingerLeft3;
			parameters[31].Value = model.FingerLeft4;
			parameters[32].Value = model.FingerLeft5;
			parameters[33].Value = model.FingerRight1;
			parameters[34].Value = model.FingerRight2;
			parameters[35].Value = model.FingerRight3;
			parameters[36].Value = model.FingerRight4;
			parameters[37].Value = model.FingerRight5;
			parameters[38].Value = model.DevSN;
			parameters[39].Value = model.DevIME;
			parameters[40].Value = model.islogin;
			parameters[41].Value = model.ClassGroup;
			parameters[42].Value = model.Native;
			parameters[43].Value = model.JZ;
			parameters[44].Value = model.JB;
			parameters[45].Value = model.ZGSJ;
			parameters[46].Value = model.RJSJ;
			parameters[47].Value = model.GZFL;
			parameters[48].Value = model.IsClassLeader;
			parameters[49].Value = model.HTGW;
			parameters[50].Value = model.SYYZ;
			parameters[51].Value = model.RYLY;
			parameters[52].Value = model.RYFL;
			parameters[53].Value = model.BYSJ;
			parameters[54].Value = model.BYXX;
			parameters[55].Value = model.XXLB;
			parameters[56].Value = model.SXZY;
			parameters[57].Value = model.XZHC;
			parameters[58].Value = model.YGXS;
			parameters[59].Value = model.HTQX;
			parameters[60].Value = model.QDSJ;
			parameters[61].Value = model.DAGZ;
			parameters[62].Value = model.JNGZ;
			parameters[63].Value = model.GWGZ;
			parameters[64].Value = model.GLGZ;
			parameters[65].Value = model.JNJD;
			parameters[66].Value = model.DY;
			parameters[67].Value = model.GWDX;
			parameters[68].Value = model.JNDX;
			parameters[69].Value = model.XGW;
			parameters[70].Value = model.XGSJ;
			parameters[71].Value = model.TXTJ;
			parameters[72].Value = model.HZ;
			parameters[73].Value = model.FJQK;
			parameters[74].Value = model.XSTQ;
			parameters[75].Value = model.HKSZD;
			parameters[76].Value = model.JTZZ;
			parameters[77].Value = model.BZ;
			parameters[78].Value = model.SFZH;
			parameters[79].Value = model.GZZH;
			parameters[80].Value = model.HYDM;
			parameters[81].Value = model.SCZ;
			parameters[82].Value = model.GZXM;
			parameters[83].Value = model.QTGZ;
			parameters[84].Value = model.BYSJ1;
			parameters[85].Value = model.TBZ;
			parameters[86].Value = model.PY;
			parameters[87].Value = model.GRJD;
			parameters[88].Value = model.LTRQ;
			parameters[89].Value = model.GLZD;
			parameters[90].Value = model.HTZZ;
			parameters[91].Value = model.LWQS;
			parameters[92].Value = model.LWZZ;
			parameters[93].Value = model.NL;
			parameters[94].Value = model.GZSJ;
			parameters[95].Value = model.SYQ;
			parameters[96].Value = model.JCRQ;
			parameters[97].Value = model.JCYY;
			parameters[98].Value = model.SHBZ;
			parameters[99].Value = model.JJBC;
			parameters[100].Value = model.YLBZ;
			parameters[101].Value = model.HTBH;
			parameters[102].Value = model.ZH;
			parameters[103].Value = model.YGFL;
			parameters[104].Value = model.HTQ;
			parameters[105].Value = model.HTZ;
			parameters[106].Value = model.DQ;
			parameters[107].Value = model.GWHGZSBH;
			parameters[108].Value = model.Image;
			parameters[109].Value = model.FID;

			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		/// <summary>
		/// 删除一条数据
		/// </summary>
		public bool Delete(long FID)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from T_PublicEmployee ");
			strSql.Append(" where FID=@FID");
			SqlParameter[] parameters = {
					new SqlParameter("@FID", SqlDbType.BigInt)
			};
			parameters[0].Value = FID;

			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}
		/// <summary>
		/// 批量删除数据
		/// </summary>
		public bool DeleteList(string FIDlist )
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("delete from T_PublicEmployee ");
			strSql.Append(" where FID in ("+FIDlist + ")  ");
			int rows=DbHelperSQL.ExecuteSql(strSql.ToString());
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public Model.T_PublicEmployee GetModel(long FID)
		{
			
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select  top 1 FID,EmployeeId,LocomotiveNo,EmployeeCardNo,Password,EmployeeName,Sex,Nation,IDnumber,PoliticalStatus,WorkShop,Job,Birthday,TechnicalTitle,CardNumber,EntryTime,PhoneNumber,LicenceDate1,LicenceDate2,Certificate,CertificateType,Education,QQ,DrivingLicenseID,Other,DocumentNo,Remark,Photograph,FingerDescribe,FingerLeft1,FingerLeft2,FingerLeft3,FingerLeft4,FingerLeft5,FingerRight1,FingerRight2,FingerRight3,FingerRight4,FingerRight5,DevSN,DevIME,islogin,ClassGroup,Native,JZ,JB,ZGSJ,RJSJ,GZFL,IsClassLeader,HTGW,SYYZ,RYLY,RYFL,BYSJ,BYXX,XXLB,SXZY,XZHC,YGXS,HTQX,QDSJ,DAGZ,JNGZ,GWGZ,GLGZ,JNJD,DY,GWDX,JNDX,XGW,XGSJ,TXTJ,HZ,FJQK,XSTQ,HKSZD,JTZZ,BZ,SFZH,GZZH,HYDM,SCZ,GZXM,QTGZ,BYSJ1,TBZ,PY,GRJD,LTRQ,GLZD,HTZZ,LWQS,LWZZ,NL,GZSJ,SYQ,JCRQ,JCYY,SHBZ,JJBC,YLBZ,HTBH,ZH,YGFL,HTQ,HTZ,DQ,GWHGZSBH,Image from T_PublicEmployee ");
			strSql.Append(" where FID=@FID");
			SqlParameter[] parameters = {
					new SqlParameter("@FID", SqlDbType.BigInt)
			};
			parameters[0].Value = FID;

			Model.T_PublicEmployee model=new Model.T_PublicEmployee();
			DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
			if(ds.Tables[0].Rows.Count>0)
			{
				return DataRowToModel(ds.Tables[0].Rows[0]);
			}
			else
			{
				return null;
			}
		}

        /// <summary>
        /// 获得Model数据列表
        /// </summary>
        public Model.T_PublicEmployee GetModel(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select FID,EmployeeId,LocomotiveNo,EmployeeCardNo,Password,EmployeeName,Sex,Nation,IDnumber,PoliticalStatus,WorkShop,Job,Birthday,TechnicalTitle,CardNumber,EntryTime,PhoneNumber,LicenceDate1,LicenceDate2,Certificate,CertificateType,Education,QQ,DrivingLicenseID,Other,DocumentNo,Remark,Photograph,FingerDescribe,FingerLeft1,FingerLeft2,FingerLeft3,FingerLeft4,FingerLeft5,FingerRight1,FingerRight2,FingerRight3,FingerRight4,FingerRight5,DevSN,DevIME,islogin,ClassGroup,Native,JZ,JB,ZGSJ,RJSJ,GZFL,IsClassLeader,HTGW,SYYZ,RYLY,RYFL,BYSJ,BYXX,XXLB,SXZY,XZHC,YGXS,HTQX,QDSJ,DAGZ,JNGZ,GWGZ,GLGZ,JNJD,DY,GWDX,JNDX,XGW,XGSJ,TXTJ,HZ,FJQK,XSTQ,HKSZD,JTZZ,BZ,SFZH,GZZH,HYDM,SCZ,GZXM,QTGZ,BYSJ1,TBZ,PY,GRJD,LTRQ,GLZD,HTZZ,LWQS,LWZZ,NL,GZSJ,SYQ,JCRQ,JCYY,SHBZ,JJBC,YLBZ,HTBH,ZH,YGFL,HTQ,HTZ,DQ,GWHGZSBH,Image ");
            strSql.Append(" FROM T_PublicEmployee ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            DataSet ds = DbHelperSQL.Query(strSql.ToString());
            if (ds != null)
                if (ds.Tables.Count > 0)
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        return DataRowToModel(ds.Tables[0].Rows[0]);
                    }
                    else return null;
                else return null;
            else return null;
        }

		/// <summary>
		/// 得到一个对象实体
		/// </summary>
		public Model.T_PublicEmployee DataRowToModel(DataRow row)
		{
			Model.T_PublicEmployee model=new Model.T_PublicEmployee();
			if (row != null)
			{
				if(row["FID"]!=null && row["FID"].ToString()!="")
				{
					model.FID=long.Parse(row["FID"].ToString());
				}
				if(row["EmployeeId"]!=null && row["EmployeeId"].ToString()!="")
				{
					model.EmployeeId=row["EmployeeId"].ToString();
				}
				if(row["LocomotiveNo"]!=null)
				{
					model.LocomotiveNo=row["LocomotiveNo"].ToString();
				}
				if(row["EmployeeCardNo"]!=null)
				{
					model.EmployeeCardNo=row["EmployeeCardNo"].ToString();
				}
				if(row["Password"]!=null)
				{
					model.Password=row["Password"].ToString();
				}
				if(row["EmployeeName"]!=null)
				{
					model.EmployeeName=row["EmployeeName"].ToString();
				}
				if(row["Sex"]!=null)
				{
					model.Sex=row["Sex"].ToString();
				}
				if(row["Nation"]!=null)
				{
					model.Nation=row["Nation"].ToString();
				}
				if(row["IDnumber"]!=null)
				{
					model.IDnumber=row["IDnumber"].ToString();
				}
				if(row["PoliticalStatus"]!=null)
				{
					model.PoliticalStatus=row["PoliticalStatus"].ToString();
				}
				if(row["WorkShop"]!=null)
				{
					model.WorkShop=row["WorkShop"].ToString();
				}
				if(row["Job"]!=null)
				{
					model.Job=row["Job"].ToString();
				}
				if(row["Birthday"]!=null)
				{
					model.Birthday=row["Birthday"].ToString();
				}
				if(row["TechnicalTitle"]!=null)
				{
					model.TechnicalTitle=row["TechnicalTitle"].ToString();
				}
				if(row["CardNumber"]!=null)
				{
					model.CardNumber=row["CardNumber"].ToString();
				}
				if(row["EntryTime"]!=null)
				{
					model.EntryTime=row["EntryTime"].ToString();
				}
				if(row["PhoneNumber"]!=null)
				{
					model.PhoneNumber=row["PhoneNumber"].ToString();
				}
				if(row["LicenceDate1"]!=null)
				{
					model.LicenceDate1=row["LicenceDate1"].ToString();
				}
				if(row["LicenceDate2"]!=null)
				{
					model.LicenceDate2=row["LicenceDate2"].ToString();
				}
				if(row["Certificate"]!=null)
				{
					model.Certificate=row["Certificate"].ToString();
				}
				if(row["CertificateType"]!=null)
				{
					model.CertificateType=row["CertificateType"].ToString();
				}
				if(row["Education"]!=null)
				{
					model.Education=row["Education"].ToString();
				}
				if(row["QQ"]!=null)
				{
					model.QQ=row["QQ"].ToString();
				}
				if(row["DrivingLicenseID"]!=null)
				{
					model.DrivingLicenseID=row["DrivingLicenseID"].ToString();
				}
				if(row["Other"]!=null)
				{
					model.Other=row["Other"].ToString();
				}
				if(row["DocumentNo"]!=null)
				{
					model.DocumentNo=row["DocumentNo"].ToString();
				}
				if(row["Remark"]!=null)
				{
					model.Remark=row["Remark"].ToString();
				}
				if(row["Photograph"]!=null && row["Photograph"].ToString()!="")
				{
					model.Photograph=(byte[])row["Photograph"];
				}
				if(row["FingerDescribe"]!=null)
				{
					model.FingerDescribe=row["FingerDescribe"].ToString();
				}
				if(row["FingerLeft1"]!=null && row["FingerLeft1"].ToString()!="")
				{
					model.FingerLeft1=(byte[])row["FingerLeft1"];
				}
				if(row["FingerLeft2"]!=null && row["FingerLeft2"].ToString()!="")
				{
					model.FingerLeft2=(byte[])row["FingerLeft2"];
				}
				if(row["FingerLeft3"]!=null && row["FingerLeft3"].ToString()!="")
				{
					model.FingerLeft3=(byte[])row["FingerLeft3"];
				}
				if(row["FingerLeft4"]!=null && row["FingerLeft4"].ToString()!="")
				{
					model.FingerLeft4=(byte[])row["FingerLeft4"];
				}
				if(row["FingerLeft5"]!=null && row["FingerLeft5"].ToString()!="")
				{
					model.FingerLeft5=(byte[])row["FingerLeft5"];
				}
				if(row["FingerRight1"]!=null && row["FingerRight1"].ToString()!="")
				{
					model.FingerRight1=(byte[])row["FingerRight1"];
				}
				if(row["FingerRight2"]!=null && row["FingerRight2"].ToString()!="")
				{
					model.FingerRight2=(byte[])row["FingerRight2"];
				}
				if(row["FingerRight3"]!=null && row["FingerRight3"].ToString()!="")
				{
					model.FingerRight3=(byte[])row["FingerRight3"];
				}
				if(row["FingerRight4"]!=null && row["FingerRight4"].ToString()!="")
				{
					model.FingerRight4=(byte[])row["FingerRight4"];
				}
				if(row["FingerRight5"]!=null && row["FingerRight5"].ToString()!="")
				{
					model.FingerRight5=(byte[])row["FingerRight5"];
				}
				if(row["DevSN"]!=null)
				{
					model.DevSN=row["DevSN"].ToString();
				}
				if(row["DevIME"]!=null)
				{
					model.DevIME=row["DevIME"].ToString();
				}
				if(row["islogin"]!=null && row["islogin"].ToString()!="")
				{
					if((row["islogin"].ToString()=="1")||(row["islogin"].ToString().ToLower()=="true"))
					{
						model.islogin=true;
					}
					else
					{
						model.islogin=false;
					}
				}
				if(row["ClassGroup"]!=null)
				{
					model.ClassGroup=row["ClassGroup"].ToString();
				}
				if(row["Native"]!=null)
				{
					model.Native=row["Native"].ToString();
				}
				if(row["JZ"]!=null)
				{
					model.JZ=row["JZ"].ToString();
				}
				if(row["JB"]!=null)
				{
					model.JB=row["JB"].ToString();
				}
				if(row["ZGSJ"]!=null)
				{
					model.ZGSJ=row["ZGSJ"].ToString();
				}
				if(row["RJSJ"]!=null)
				{
					model.RJSJ=row["RJSJ"].ToString();
				}
				if(row["GZFL"]!=null)
				{
					model.GZFL=row["GZFL"].ToString();
				}
				if(row["IsClassLeader"]!=null)
				{
					model.IsClassLeader=row["IsClassLeader"].ToString();
				}
				if(row["HTGW"]!=null)
				{
					model.HTGW=row["HTGW"].ToString();
				}
				if(row["SYYZ"]!=null)
				{
					model.SYYZ=row["SYYZ"].ToString();
				}
				if(row["RYLY"]!=null)
				{
					model.RYLY=row["RYLY"].ToString();
				}
				if(row["RYFL"]!=null)
				{
					model.RYFL=row["RYFL"].ToString();
				}
				if(row["BYSJ"]!=null)
				{
					model.BYSJ=row["BYSJ"].ToString();
				}
				if(row["BYXX"]!=null)
				{
					model.BYXX=row["BYXX"].ToString();
				}
				if(row["XXLB"]!=null)
				{
					model.XXLB=row["XXLB"].ToString();
				}
				if(row["SXZY"]!=null)
				{
					model.SXZY=row["SXZY"].ToString();
				}
				if(row["XZHC"]!=null)
				{
					model.XZHC=row["XZHC"].ToString();
				}
				if(row["YGXS"]!=null)
				{
					model.YGXS=row["YGXS"].ToString();
				}
				if(row["HTQX"]!=null)
				{
					model.HTQX=row["HTQX"].ToString();
				}
				if(row["QDSJ"]!=null)
				{
					model.QDSJ=row["QDSJ"].ToString();
				}
				if(row["DAGZ"]!=null)
				{
					model.DAGZ=row["DAGZ"].ToString();
				}
				if(row["JNGZ"]!=null)
				{
					model.JNGZ=row["JNGZ"].ToString();
				}
				if(row["GWGZ"]!=null)
				{
					model.GWGZ=row["GWGZ"].ToString();
				}
				if(row["GLGZ"]!=null)
				{
					model.GLGZ=row["GLGZ"].ToString();
				}
				if(row["JNJD"]!=null)
				{
					model.JNJD=row["JNJD"].ToString();
				}
				if(row["DY"]!=null)
				{
					model.DY=row["DY"].ToString();
				}
				if(row["GWDX"]!=null)
				{
					model.GWDX=row["GWDX"].ToString();
				}
				if(row["JNDX"]!=null)
				{
					model.JNDX=row["JNDX"].ToString();
				}
				if(row["XGW"]!=null)
				{
					model.XGW=row["XGW"].ToString();
				}
				if(row["XGSJ"]!=null)
				{
					model.XGSJ=row["XGSJ"].ToString();
				}
				if(row["TXTJ"]!=null)
				{
					model.TXTJ=row["TXTJ"].ToString();
				}
				if(row["HZ"]!=null)
				{
					model.HZ=row["HZ"].ToString();
				}
				if(row["FJQK"]!=null)
				{
					model.FJQK=row["FJQK"].ToString();
				}
				if(row["XSTQ"]!=null)
				{
					model.XSTQ=row["XSTQ"].ToString();
				}
				if(row["HKSZD"]!=null)
				{
					model.HKSZD=row["HKSZD"].ToString();
				}
				if(row["JTZZ"]!=null)
				{
					model.JTZZ=row["JTZZ"].ToString();
				}
				if(row["BZ"]!=null)
				{
					model.BZ=row["BZ"].ToString();
				}
				if(row["SFZH"]!=null)
				{
					model.SFZH=row["SFZH"].ToString();
				}
				if(row["GZZH"]!=null)
				{
					model.GZZH=row["GZZH"].ToString();
				}
				if(row["HYDM"]!=null)
				{
					model.HYDM=row["HYDM"].ToString();
				}
				if(row["SCZ"]!=null)
				{
					model.SCZ=row["SCZ"].ToString();
				}
				if(row["GZXM"]!=null)
				{
					model.GZXM=row["GZXM"].ToString();
				}
				if(row["QTGZ"]!=null)
				{
					model.QTGZ=row["QTGZ"].ToString();
				}
				if(row["BYSJ1"]!=null)
				{
					model.BYSJ1=row["BYSJ1"].ToString();
				}
				if(row["TBZ"]!=null)
				{
					model.TBZ=row["TBZ"].ToString();
				}
				if(row["PY"]!=null)
				{
					model.PY=row["PY"].ToString();
				}
				if(row["GRJD"]!=null)
				{
					model.GRJD=row["GRJD"].ToString();
				}
				if(row["LTRQ"]!=null)
				{
					model.LTRQ=row["LTRQ"].ToString();
				}
				if(row["GLZD"]!=null)
				{
					model.GLZD=row["GLZD"].ToString();
				}
				if(row["HTZZ"]!=null)
				{
					model.HTZZ=row["HTZZ"].ToString();
				}
				if(row["LWQS"]!=null)
				{
					model.LWQS=row["LWQS"].ToString();
				}
				if(row["LWZZ"]!=null)
				{
					model.LWZZ=row["LWZZ"].ToString();
				}
				if(row["NL"]!=null)
				{
					model.NL=row["NL"].ToString();
				}
				if(row["GZSJ"]!=null)
				{
					model.GZSJ=row["GZSJ"].ToString();
				}
				if(row["SYQ"]!=null)
				{
					model.SYQ=row["SYQ"].ToString();
				}
				if(row["JCRQ"]!=null)
				{
					model.JCRQ=row["JCRQ"].ToString();
				}
				if(row["JCYY"]!=null)
				{
					model.JCYY=row["JCYY"].ToString();
				}
				if(row["SHBZ"]!=null)
				{
					model.SHBZ=row["SHBZ"].ToString();
				}
				if(row["JJBC"]!=null)
				{
					model.JJBC=row["JJBC"].ToString();
				}
				if(row["YLBZ"]!=null)
				{
					model.YLBZ=row["YLBZ"].ToString();
				}
				if(row["HTBH"]!=null)
				{
					model.HTBH=row["HTBH"].ToString();
				}
				if(row["ZH"]!=null)
				{
					model.ZH=row["ZH"].ToString();
				}
				if(row["YGFL"]!=null)
				{
					model.YGFL=row["YGFL"].ToString();
				}
				if(row["HTQ"]!=null)
				{
					model.HTQ=row["HTQ"].ToString();
				}
				if(row["HTZ"]!=null)
				{
					model.HTZ=row["HTZ"].ToString();
				}
				if(row["DQ"]!=null)
				{
					model.DQ=row["DQ"].ToString();
				}
				if(row["GWHGZSBH"]!=null)
				{
					model.GWHGZSBH=row["GWHGZSBH"].ToString();
				}
				if(row["Image"]!=null && row["Image"].ToString()!="")
				{
					model.Image=(byte[])row["Image"];
				}
			}
			return model;
		}

		/// <summary>
		/// 获得数据列表
		/// </summary>
		public DataSet GetList(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select FID,EmployeeId,LocomotiveNo,EmployeeCardNo,Password,EmployeeName,Sex,Nation,IDnumber,PoliticalStatus,WorkShop,Job,Birthday,TechnicalTitle,CardNumber,EntryTime,PhoneNumber,LicenceDate1,LicenceDate2,Certificate,CertificateType,Education,QQ,DrivingLicenseID,Other,DocumentNo,Remark,Photograph,FingerDescribe,FingerLeft1,FingerLeft2,FingerLeft3,FingerLeft4,FingerLeft5,FingerRight1,FingerRight2,FingerRight3,FingerRight4,FingerRight5,DevSN,DevIME,islogin,ClassGroup,Native,JZ,JB,ZGSJ,RJSJ,GZFL,IsClassLeader,HTGW,SYYZ,RYLY,RYFL,BYSJ,BYXX,XXLB,SXZY,XZHC,YGXS,HTQX,QDSJ,DAGZ,JNGZ,GWGZ,GLGZ,JNJD,DY,GWDX,JNDX,XGW,XGSJ,TXTJ,HZ,FJQK,XSTQ,HKSZD,JTZZ,BZ,SFZH,GZZH,HYDM,SCZ,GZXM,QTGZ,BYSJ1,TBZ,PY,GRJD,LTRQ,GLZD,HTZZ,LWQS,LWZZ,NL,GZSJ,SYQ,JCRQ,JCYY,SHBZ,JJBC,YLBZ,HTBH,ZH,YGFL,HTQ,HTZ,DQ,GWHGZSBH,Image ");
			strSql.Append(" FROM T_PublicEmployee ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			return DbHelperSQL.Query(strSql.ToString());
		}

		/// <summary>
		/// 获得前几行数据
		/// </summary>
		public DataSet GetList(int Top,string strWhere,string filedOrder)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select ");
			if(Top>0)
			{
				strSql.Append(" top "+Top.ToString());
			}
			strSql.Append(" FID,EmployeeId,LocomotiveNo,EmployeeCardNo,Password,EmployeeName,Sex,Nation,IDnumber,PoliticalStatus,WorkShop,Job,Birthday,TechnicalTitle,CardNumber,EntryTime,PhoneNumber,LicenceDate1,LicenceDate2,Certificate,CertificateType,Education,QQ,DrivingLicenseID,Other,DocumentNo,Remark,Photograph,FingerDescribe,FingerLeft1,FingerLeft2,FingerLeft3,FingerLeft4,FingerLeft5,FingerRight1,FingerRight2,FingerRight3,FingerRight4,FingerRight5,DevSN,DevIME,islogin,ClassGroup,Native,JZ,JB,ZGSJ,RJSJ,GZFL,IsClassLeader,HTGW,SYYZ,RYLY,RYFL,BYSJ,BYXX,XXLB,SXZY,XZHC,YGXS,HTQX,QDSJ,DAGZ,JNGZ,GWGZ,GLGZ,JNJD,DY,GWDX,JNDX,XGW,XGSJ,TXTJ,HZ,FJQK,XSTQ,HKSZD,JTZZ,BZ,SFZH,GZZH,HYDM,SCZ,GZXM,QTGZ,BYSJ1,TBZ,PY,GRJD,LTRQ,GLZD,HTZZ,LWQS,LWZZ,NL,GZSJ,SYQ,JCRQ,JCYY,SHBZ,JJBC,YLBZ,HTBH,ZH,YGFL,HTQ,HTZ,DQ,GWHGZSBH,Image ");
			strSql.Append(" FROM T_PublicEmployee ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			strSql.Append(" order by " + filedOrder);
			return DbHelperSQL.Query(strSql.ToString());
		}

		/// <summary>
		/// 获取记录总数
		/// </summary>
		public int GetRecordCount(string strWhere)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("select count(1) FROM T_PublicEmployee ");
			if(strWhere.Trim()!="")
			{
				strSql.Append(" where "+strWhere);
			}
			object obj = DbHelperSQL.GetSingle(strSql.ToString());
			if (obj == null)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(obj);
			}
		}
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append("SELECT * FROM ( ");
			strSql.Append(" SELECT ROW_NUMBER() OVER (");
			if (!string.IsNullOrEmpty(orderby.Trim()))
			{
				strSql.Append("order by T." + orderby );
			}
			else
			{
				strSql.Append("order by T.FID desc");
			}
			strSql.Append(")AS Row, T.*  from T_PublicEmployee T ");
			if (!string.IsNullOrEmpty(strWhere.Trim()))
			{
				strSql.Append(" WHERE " + strWhere);
			}
			strSql.Append(" ) TT");
			strSql.AppendFormat(" WHERE TT.Row between {0} and {1}", startIndex, endIndex);
			return DbHelperSQL.Query(strSql.ToString());
		}

		/*
		/// <summary>
		/// 分页获取数据列表
		/// </summary>
		public DataSet GetList(int PageSize,int PageIndex,string strWhere)
		{
			SqlParameter[] parameters = {
					new SqlParameter("@tblName", SqlDbType.VarChar, 255),
					new SqlParameter("@fldName", SqlDbType.VarChar, 255),
					new SqlParameter("@PageSize", SqlDbType.Int),
					new SqlParameter("@PageIndex", SqlDbType.Int),
					new SqlParameter("@IsReCount", SqlDbType.Bit),
					new SqlParameter("@OrderType", SqlDbType.Bit),
					new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
					};
			parameters[0].Value = "T_PublicEmployee";
			parameters[1].Value = "FID";
			parameters[2].Value = PageSize;
			parameters[3].Value = PageIndex;
			parameters[4].Value = 0;
			parameters[5].Value = 0;
			parameters[6].Value = strWhere;	
			return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
		}*/

		#endregion  BasicMethod
		#region  ExtensionMethod 
        
		public bool UpdatePhoto(string employeeid,byte[]b)
		{
			StringBuilder strSql=new StringBuilder();
			strSql.Append(" update T_PublicEmployee set ");
			strSql.Append(" Photograph=@Photograph "); 
            strSql.Append(" where EmployeeId=@EmployeeId ");
			SqlParameter[] parameters = {
					new SqlParameter("@EmployeeId", SqlDbType.NVarChar,20),
					new SqlParameter("@Photograph", SqlDbType.Image)};
			parameters[0].Value = employeeid;
			parameters[1].Value = b; 
			int rows=DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
			if (rows > 0)
			{
				return true;
			}
			else
			{
				return false;
			}
		}

		#endregion  ExtensionMethod
	}
}

